0

I am struggling a bit with accessing individual values in list that is returned by APEX code into the flow.

public class DynamicField {
    @InvocableVariable
    public String key;

    @InvocableVariable
    public String value;

    public DynamicField(String key, String value) {
        this.key = key;
        this.value = value;
    }
}

I return List<List> and I am able to loop through and print each list. The keys and values are there and I am able to show them in form:

{
  "key": "value"
}

But in the flow, I would like to assign the value to a specific variable. And so far I am able to assign only the list, not the value.

Any idea how to do it?

Thanks.

1 Answer 1

0

To access individual values from the List in your Flow:

Loop through the List: Add a Loop element to iterate through the outer list of DynamicField objects.

Use Decision inside the Loop: Check the key using a Decision element to find the specific field you're looking for (like "email" or "phone").

Assign the Value: Once the key matches, use an Assignment element to store the corresponding value into a Flow variable.

This lets you extract specific values from your list and use them in the Flow. Simple as that!

1
  • I already tried that but cant access the keys. ibb.co/vkMkVKR Commented Oct 22, 2024 at 14:50

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.