Hello guys,
I'm new to PowerApps and I don't understand some things:
1. In my case I have a screen with two "Form" object linked to the same Sharepoint site and list (why I use two time the same Site and list? for a look problem), in one of the two form I have a "Choise field" (imported from the sharepoint connector) called "Society" and I need to use an "If" function for make the choose shorter (I need that because I want generate a custom unique ID) so I made this:
[OnChange] (In the Society card (SharePoint data connector) [card type: Choise field])
If(Concat(DataCardValue72.SelectedItems;Value;"") = "Society1"; UpdateContext({varSocietyShort:"S1"});"NO")
If(Concat(DataCardValue72.SelectedItems;Value;"") = "Society2"; UpdateContext({varSocietyShort:"S2"});"NO")
If(Concat(DataCardValue72.SelectedItems;Value;"") = "Society3"; UpdateContext({varSocietyShort:"S3"});"NO")
The problem is: Im sure the "If" function work because if I take a "Label" and I put in the same level of the data card in the "Tree view" with this function:
[Text] (Label setting)
If(Concat(DataCardValue72.SelectedItems;Value;"") = "Society1";"S1";"NO")
Work! But if I try to use any variable (Set or UpdateContext) the variable remain "Blank" in any case!
Another problem is if I copy the working label to the "Screen level" of the Tree View it's doesn't work!
There is a way to fix this?
Thx in advance!
Davide (or Dave)
Solved! Go to Solution.
ALSO...
Make sure your form DefaultMode is set to New, or, if you really intend to have it in View or Edit, then make sure you are supplying a valid record to the Item property of the form.
I hope this is helpful for you.
Hi @Davide_PM6176 ,
You might try this
With(
{
wVal:
Concat(
DataCardValue72.SelectedItems;
Value;""
)
};
UpdateContext(
{
varSocietyShort:
Switch(
wVal;
"Society1";
"S1";
"Society2";
"S2";
"Society3";
"S3";
"NO"
)
}
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
Visit my blog Practical Power Apps
Hello @WarrenBelz! Thanks you for the fast reply!
I've try to put your formula on the:
[OnChange] (In the Society card (SharePoint data connector) [card type: Choise field])
But the variable "varSocietyShort" is still "Blank" :C
I do a mistake?
Thx!
ALSO...
Make sure your form DefaultMode is set to New, or, if you really intend to have it in View or Edit, then make sure you are supplying a valid record to the Item property of the form.
I hope this is helpful for you.
Hi @Davide_PM6176 ,
What are the Items of DataCardValue72 and why are your using Concat() if there is only one choice?
Well done - your ESP is better than mine - I have read this several times and I still don't see that as the issue from the information posted.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
204 | |
71 | |
51 | |
49 | |
20 |
User | Count |
---|---|
260 | |
121 | |
85 | |
75 | |
72 |