cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AndyC
Level: Powered On

I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

 

Hi,

 

I am new to Powerapps and am learning my way about it, but there is one thing I simply cannot get to work:

 

I want to use a hyperlink to a Powerapps Form, opening a relevant row from the Sharepoint list, using the ID field of that list.

 

For example I have tried:

 

https://web.powerapps.com/apps/6237be25-f9ae-4ef7<REDACTED>8f4?id=30

 

Which I would expect to open my Powerapps Form pre-populated with fields from the record where ID=30. But no matter what I try the fields come up blank.

 

I can see three areas where I may be going wrong:

 

1. There is something wrong with the syntax of my link.

 

2. There is something wrong with the form attributes (I have tried setting DefaultMode to FormMode= New, Edit and Read).

3. My web address is referencing my powerapp in general, but I need to reference the Form embedded in the App.

Can anyone help me with this please?

 

many thanks in advance,

 

Andy

 

I think there are two areas I


Accepted Solutions
AndyC
Level: Powered On

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @vecerpa and everyone,

 

working from your notes and understanding what is going on I have cracked it (hurrah).

 

I used a parameter at the end of the URL:

 

... e8f4?h_s_id=29

 

Using @vecerpa 's notes I passed this into a variable RecordLookup in the screen's OnStart field

 

Set(RecordLookup,Param("h_s_id")) 

 

And then on the Form, the into the Item field I put:

 

LookUp('HandS Test 1.0', ID=RecordLookup)

 

And it opens populated.

 

Thanks for your help @vecerpa - I would not have worked it out without you.

 

And I am writing this up as it seems to be nowhere else on the Internet. This is probably Kindergarten stuff for you experienced PUs, but I am just setting out (and have learned a lot in this process).

 

Cheers,

 

Andy

 


All Replies
vivekb
Level 10

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

@AndyC

 

can you add some screenshots from your app with the code that you are using?

 

The link that you gave is not loading anything.

vecerpa
Level 10

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @AndyC,

 

You should also catch parameter that you are delivering in url in your powerapp. 

For example I'm sending to my app SharePointItem.

 

https://web.powerapps.com/apps/<appID>?SharePointItem=30

So in app I'm loading it to variable with this function:

 

Set(ListItemID;Param("SharePointItem"))

So then I can use inside my application variable ListIdemID to refer to this item in SharePoint list.

 

Hope this will help you

P.

AndyC
Level: Powered On

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @vecerpa - thanks for the imput.

 

I am very much a newbiew, and understand what you are saying in principle, but would be really grateful if you could let me check I understand, and where to put in the functions:

 

Where does the set variable go: 

Set(ListItemID;Param("SharePointItem)) _ I tried it in the OnVisible field for the screen but Powerapps did not like the syntax.

 

Secondly, I take it I need to have the ID field and have SharePointItem as the value in that. Again, which attribute do I put that in , and is there any particular syntax.

 

Sorry to ask such basic questions - I have been tasked with coming up with this workflow and am learning on the job.

 

Many thanks,

 

Andy

vecerpa
Level 10

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @AndyC,

 

Place where should be this expression used is in OnStart on your landindg screen. Here you can load your parameter from link into variable.

 

FlowParamOnStart.PNG

 

then I load it into label text via ListItemID

 

FlowParamOnStart2.PNG

 

So after this you can check if your variable was loaded correctly when you open the app with link, where param is defined.

 

Hope it is clearer for you

P.

AndyC
Level: Powered On

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @vecerpa,

 

you are being incredibly helpful and I am being a bit thick.

 

Sorry to be a pain but can you please let me have another example of the second screenshot where you define Text but 'zoomed out' a bit (a greater portion of the screen) so I can better understand what is selected in the left list and the context of it?

 

Your help is getting me tantalisingly close to cracking this and I am grateful for your time.

 

Andy

vecerpa
Level 10

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @AndyC,

 

So If you are using classic form to display sharepoint items then use the parameter (variable) for gallery to prefilter item, showa basic info and in form display details or show all details directly in gallery.

 

So then the filter function will look like this for gallery.

 

Filter(SeznamNajemneho;ID=ListItemID)

"SeznamNajemneho" is my sharepoint list. I used it in gallery - Items.

 

FlowParamOnStart3.PNG 

 

So I hope this will be helpful.

P.

 

 

AndyC
Level: Powered On

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Ho @vecerpa - still need a little healp. At the moment with tomorrow being Monday as well as being thick I have now enjoyed a stiff couple of gin and tonics. So in my even less than ideal state ... I am not using a gallery just a form, hope this is making sense. Screenshot:

 

Next_no_gallery.JPG

 

Now I know I am being a pain, but where do I bung the Text=ListitemID attribute? I tried a test Powerapp with all fields, both made by me and system inclided, which includes the ID set by the Sharepoint list, but this was automatically inserted into Powerapps  as a read only field. So the option was not there to include some code.

 

Maybe the clear light of day will make me understand a little clearer. But if you are able to help further then that would be great.

 

Andy.

AndyC
Level: Powered On

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @vecerpa and anyone who might help.

 

@vecerpa I have got my head around what you are suggesting and realise why I had trouble understanding. And it is down to my using 'item' rather than row in my initial post.

 

Going through the thread again I think I am understanding in what you are suggesting is to pass an item from a parameter in the URL to a variable in the Powerapps form.

 

What I am after is a bit different. I want to use the ID from a row in my sharepoint list in a URL to open a powerapps form with all the fields populated.

 

For example if I have a list:

 

ID     Greeting     Favourite Colour

30     Hello          Green

 

I want to use a URL to open a powerapps form prepopulated:

 

ID                           30

Greeting                 Hello

Favourite Colour    Green

 

And try as I might I cannot get it to work.

 

many thanks for your help.

AndyC
Level: Powered On

Re: I simply want to open a Powerapps form pre-populated with a Sharepoint List Item

Hi @vecerpa and everyone,

 

working from your notes and understanding what is going on I have cracked it (hurrah).

 

I used a parameter at the end of the URL:

 

... e8f4?h_s_id=29

 

Using @vecerpa 's notes I passed this into a variable RecordLookup in the screen's OnStart field

 

Set(RecordLookup,Param("h_s_id")) 

 

And then on the Form, the into the Item field I put:

 

LookUp('HandS Test 1.0', ID=RecordLookup)

 

And it opens populated.

 

Thanks for your help @vecerpa - I would not have worked it out without you.

 

And I am writing this up as it seems to be nowhere else on the Internet. This is probably Kindergarten stuff for you experienced PUs, but I am just setting out (and have learned a lot in this process).

 

Cheers,

 

Andy