cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brice235i
Skilled Sharer
Skilled Sharer

Open PowerApp to display a specific item's detail

Hello there, I have a app built from a SharePoint list with an approval Flow.  In the approval email, instead of linking to the item in SharePoint, I would like to open the item in the PowerApp - the Details Screen for the item that needs to be approved.  

I have tried using instructions provided in various posts, but I can't seem to get this working.  

 

For the onVisible attribute of the screen I have:

ResetForm(EditForm1);Set(varID,Param("ID"))

 

For the Form I have entered into the Items field:

 First(Filter('data connection name', ID=varID))

 

 

There  is unfortunately an error:

 

The error on the Form Item field: "Incompatible type.  We can't evaluate your formula because the values being compared in the formula aren't the same type.  The left value is a Number type and the right value is a Text type."

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Brice235i,

The error message told that there is an Incompatible type error with the formula that you provided within the Item property of the Edit form.

Please take a try to modify your formula as below:

Set the OnVisible property of the first screen of your app to following:

ResetForm(EditForm1);
Set(varID, Value(Param("ID")))

Set the Item property of the Edit form to following:

First(Filter('data connection name', ID=varID))

Or
Set the OnVisible property of the first screen of your app to following:

ResetForm(EditForm1);
Set(varID, Param("ID"))

Set the Item property of the Edit form to following:

First(Filter('data connection name', ID= Value(varID)))

Please also check and see my response within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-always-going-to-first-item-for-list-de...

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
seadude
Memorable Member
Memorable Member

I ran into this quite often early on as well.

 

Try:

Set(Value(varID),Param("ID"))

This should set the variable "varID" to a number (from a string).

If this doesn't work, wherever you are setting varID, change it to a string there.

Example:

Set(varID, Value(whatever.Text))

 

Thank you very much for your reply.  As you probably realised, yes very new to PowerApps and not so good with formulas!

 

I can't get this to work either unfortunately.  One the welcome screen onStart property:

onstart_valueTextinFormula.png

 

Then I tried the second option:

convertexterror.pngthanks!

All good, you're trying!

 

What is "Param"? Is that a Collection or the Sharepoint list?

It is to pass the parameter seadude 🙂

I got the idea here - https://blog.kloud.com.au/2017/10/17/how-to-pass-parameters-into-a-powerapp/ 

Basically, I'm trying to create a URL  that opens to the details screen for a specific list item.  The URL in the Flow approval email goes to the item in SharePoint, but the client complained... they want it to open in the PowerApp interface.

It seems fairly complicated so maybe I'm on the wrong track with Param...

Hm. Thanks for opening my eyes to the possibility of opening a link to an item IN POWERAPPS. I had no idea that was possible.

 

Anywho, back to your issue:
- Looks like you can't turn varID into a number (wrap it in Valu() ).

- Instead, you need to turn the "ID" in First(Filter('data connection name', ID=varID)) into a String so that the data types match.

- The way you do this is to wrap "ID" in the Text() function.

- Maybe try First(Filter('data connection name', Text(ID, "en")=varID))

Thank you, some great ideas.  Will try a few things and update later on 🙂

v-xida-msft
Community Support
Community Support

Hi @Brice235i,

The error message told that there is an Incompatible type error with the formula that you provided within the Item property of the Edit form.

Please take a try to modify your formula as below:

Set the OnVisible property of the first screen of your app to following:

ResetForm(EditForm1);
Set(varID, Value(Param("ID")))

Set the Item property of the Edit form to following:

First(Filter('data connection name', ID=varID))

Or
Set the OnVisible property of the first screen of your app to following:

ResetForm(EditForm1);
Set(varID, Param("ID"))

Set the Item property of the Edit form to following:

First(Filter('data connection name', ID= Value(varID)))

Please also check and see my response within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Lookup-always-going-to-first-item-for-list-de...

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thank you kindly.  That worked well.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,412)