I have created a canvas powerapp with multiple screens. Each screen has a form connected to a SharePoint List data source, and all of the forms connect to the same SP list. I have a submit button on the last app screen that onselect patches all of the forms into the data source and generates a url with a parameter called ReqID.
I am trying to get a deep/direct link to work so that I can send the record's custom url in an approval flow. When the url is accessed, I want it to take a user to the app and autopopulate the form fields with data from the specified record. To do that, I have set the app onstart to be the below:
Set(
varReqID,
Value(Param("ReqID"))
);
If (
varReqID <> 0,
Set(
varRecord,
LookUp(
Onboarding,
ID = varReqID
)
)
)
I have also set the item of the various forms to be varRecord which should do a lookup and populate the forms. I have tried lookup and filter but it does not work. I also tried setting the datacard defaults to do the lookup, but with all options I am unable to get the forms to show the existing data - everything defaults to blank like a new form.
What am I missing here? Any help is appreciated - I am a powerapps novice and have been able to figure out most things by watching videos and reading community articles, but this one has me completely stumped.
Solved! Go to Solution.
Thanks @bheiland ,
I assume you mean you are only ever navigating to the screen/form from the deep linking? That is even easier - you do not need the If(!IsBlank) test at the start and just ignore the Gallery bit.
Set(
varReqID,
Value(Param("ReqID"))
);
Navigate(YourRequiredScreen)
The Edit form will work with the code as you are setting the ID and using this to set the Item of the form.
LookUp(
Onboarding,
ID = varReqID
)
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.
Hi @bheiland ,
I use Deep Linking quite a bit, but take a different track.
Firstly App OnStart
If(
!IsBlank(
Param("ReqID"),
Set(
varReqID,
Value(Param("ReqID"))
);
Navigate(YourRequiredScreen)
)
On the OnSelect of any gallery you are selecting to and navigating to this screen
Set(varReqID,ThisItem.ID);
Navigate(YourRequiredScreen)
Now the Item of your form
LookUp(
Onboarding,
ID = varReqID
)
I am happy to try to look into your issue if you want a different model, but the above works.
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.
Thanks @bheiland ,
I assume you mean you are only ever navigating to the screen/form from the deep linking? That is even easier - you do not need the If(!IsBlank) test at the start and just ignore the Gallery bit.
Set(
varReqID,
Value(Param("ReqID"))
);
Navigate(YourRequiredScreen)
The Edit form will work with the code as you are setting the ID and using this to set the Item of the form.
LookUp(
Onboarding,
ID = varReqID
)
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.
@WarrenBelz That was my initial thought before building the lookup into the app onstart. I have tried that approach but the form still does not populate with existing data from the SharePoint data source.
Any other ideas?
Hi @bheiland ,
The problem must be in the deep linked parameter - the Lookup has to work on the form if you have the ID of the item you are wanting to show. Put a label on the screen with varReqID and see what is displayed in it when you launch from the deep-link URL. Also what is the deep-link URL format (put xxx in stead of the numbers but include any ? or & signs.
@WarrenBelz on launch the variable written to a label field is showing correctly - it pulls in the number from the SharePoint list that is then included in the url to be varReqID. Even though the label is showing the value, the form fields are not populating correctly.
The url format is https://web.powerapps.com/apps/(appid)?ReqID=xxx
I have the app onstart set to:
Set(varReqID, Value(Param("ReqID")));Navigate('Enter Employee Info')
and the form item set to:
LookUp(Onboarding,ID=varReqID)
@WarrenBelz I finally figured it out - I'm embarrassed to admit it was an issue with my form mode. I was positive my form was in edit mode but it was still in new.
Thank you for your assistance!
No Problems @bheiland that will do it every time . . .
I will remember that one if I get something similar in the future - I never thought to ask that.
This is a great solution. I just can't use navigate in OnStart. Is there another way around that?
User | Count |
---|---|
122 | |
87 | |
86 | |
75 | |
67 |
User | Count |
---|---|
214 | |
180 | |
137 | |
96 | |
83 |