I have been using the set() function to maintain a global variable in a multiscreen app. The variable is text and is set from the itemselected operator from a gallery as well as strings...
eg
1. Set(AuditTypePerformed,"Vehicle")
2. Set(AuditTypePerformed,Gallery2.Selected.TypeOfAudit)
3. Set(AuditTypePerformed,Gallery3.Selected.InspectionType)
Now number 2 and 3 above are galleries linked to different collections.
I then add a 3rd gallery to the screen and set another datasource. In this gallery I use the Set(AuditTypePerformed... and suddenly all controls using this command error out with the message:
"The types of the specified global variables are incompatible with the types specified elsewhere"
Interesingly, even if I delete the new gallery from the app, the error does not clear and the global variable is in a state of "Error"
I can confirm at all times I am dealing with strings with this variable. Any ideas?
Solved! Go to Solution.
I tried this previously with no luck, but after pondering your suggestiion I took a different tack. Basically anytime I used the Set() and the value came from a control, I wrapped it in a text() function, *before* I added the new gallery.
This time I am happy to report it worked. I suspect this issue is similar to something that happens when you clear and manipulate collections that have been previously initiualised in that you cannot change the schema. I checked at all times that the variable was reporting a type of "text" before making this change, so I guess this function really forces text.
Thankyou so much for the quick response... I still think there is a bug here somewhere but this at least makes it go away.
Paul
Hi @Anonymous,
I think the error here should be mostly related with the field type.
Please take a try to add Text() function with the other Gallery.selected.value within the Set function, see if this would make any difference.
For example:
Set(AuditTypePerformed, text(Gallery2.Selected.TypeOfAudit) )
Regards,
Michael
I tried this previously with no luck, but after pondering your suggestiion I took a different tack. Basically anytime I used the Set() and the value came from a control, I wrapped it in a text() function, *before* I added the new gallery.
This time I am happy to report it worked. I suspect this issue is similar to something that happens when you clear and manipulate collections that have been previously initiualised in that you cannot change the schema. I checked at all times that the variable was reporting a type of "text" before making this change, so I guess this function really forces text.
Thankyou so much for the quick response... I still think there is a bug here somewhere but this at least makes it go away.
Paul
User | Count |
---|---|
256 | |
108 | |
97 | |
51 | |
39 |