Cannot assign value from repeated list to app variable

I’ve got a repeated list from a data variable, successfully putting two values from that data onto each of the repeatable items. When I tap on an item from the list, I have a “set app variable” logic action to store the value of the selected item in an app variable.

The problem is, when I tap on the list, the value of the list (chosen via the “current.” etc. schema) is not being passed - and the logic action ends up storing a null - wiping out the value that was already in the app variable.

I know that the value I’m trying to store is correctly chosen for this action, because it is the identical property that puts the displayed value onto the list (so, what you see in the list is what I’m trying to store).

Variable type of the app variable is “text”. Value of the data variable I’m attempting to put into it is “any text” after experimenting. It was originally “text” and didn’t work.

…any ideas why the passed info will not store into the app variable?


So in the list you display two values from a data variable, and you want to save that combination into the app variable as well? And is this combination what you mean by the value of the list?

How have you currently assigned the value of the app variable in the “Set app variable” function?

The current value was assigned directly at app launch in the global canvas, simply for testing purposes. It is irrelevant to the app; the first assignment will be from tapping the list.

You are mostly correct; the two values displayed in the list are to be stored in the app variable, but not as any combination unto themselves; the app variable is a complex object. The location these will be stored in are actually separate properties of a subordinate object inside the main object.

Having the initial (testing) value being wiped out tells me the property is being reach properly, it’s the source that is failing to be accessed. …the exact data variable source that is used to visibly populate the list.

You can see from the attachments that the references for the variables are the same - the information should be passing

Hmm that is odd, at first glance everything looks like it should work. So the is being set as null when it should be set at current.fields.Name, in that preview example as “Kingsland”?

A common issue in this type of case is that current.fields would be undefined, which means current.fields.Name ends up in null.

A quick fix you could try is using a formula as the assigned value, perhaps

LOOKUP(current.fields, "Name")

Composer usually prefers that way instead of long dot notations. The formula editor might also give some kind of warning or notice that might point us closer to the issue.

Let me know how it goes!

That fixed it - using a lookup formula instead of dot notation made it work perfectly. Why it happens is still a mystery - but the fix will be my new standard. Thank you!

Great that it worked! It is a bit confusing and it will be fixed in our upcoming 2.x release. Until then I recommend trying LOOKUP() if something similar happens again :blush: