cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Iamglt
Helper V
Helper V

Using Deep Linking to open a Screen and navigate to a record ID

Hi,

I have set up a Power Automate workflow that provides a link to the record that was created in a SharePoint list.  I want the user who receives this automated email (Power Automate - Send Email Notification v2) to be able to click on the link, and their unique screen (called SScreen) opens with the record ID that was just created.

The Power Automate HTML is as follows and opens the correct screen:

Iamglt_1-1614762346966.png

I am now trying to set a variable to the ID using the Param statement:

 

If(
    Param("DL152") = "Screen1", Set(varCurrRecord,Param("ID")) And Navigate(SScreen)
)

 

 I am getting an incompatible type. we can't evaluate your formula because the context variable types are incompatible with the types of values in other places in your app.  The varCurrRecord is normally set from the gallery record ID if a record is opened from the gallery, so I am not sure why I cant set it to the Param("ID").

Can anyone advise why I am getting this error?

Cheers,

G.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RusselThomas
Microsoft
Microsoft

hi @Iamglt ,

Apologies, I spotted the missing bracket and updated my post after posting it.

With that sorted though, you can at least work through the type mismatch.

Out of interest, your variable name seems to imply that it contains a whole record, whereas here you're setting it to a single field value.  If it's meant to be a whole record, perhaps set it to the result of a lookup using the ID instead of setting it to the ID itself.

If it is being set to just the value of a record ID, this is a numerical value and parameters are by default text, so you may want to change it to 

If(
    Param("DL152") = "Screen1", 
       Set(varCurrRecord,Value(Param("ID")));
       Navigate(SScreen)
)

and see if that works?

Kind regards,

RT

View solution in original post

4 REPLIES 4
RusselThomas
Microsoft
Microsoft

Hi @Iamglt 

You may have to fix your If() statement before troubleshooting the rest.  Your If() statement looks like it contains a condition after the condition;

 

 

If(
    Param("DL152") = "Screen1", Set(varCurrRecord,Param("ID")) And Navigate(SScreen)
)

 

 

This would probably be a primary problem, with variable types coming in second. 

You can't add actions using a condition like AND after you've already tested the condition, you need to add the action as a new action using semi-colon to separate them within the If() statement;

 

 

If(
    Param("DL152") = "Screen1", 
       Set(varCurrRecord,Param("ID"));
       Navigate(SScreen)
)

 

 

 Also, SScreen would have to be defined somewhere as a Screen for this to work.

Once you've addressed the syntax we can then see what errors remain and address them.

Hope this helps,

RT

Hi Russel,

Thanks for your response - I tried your way and I get the following error:

Iamglt_0-1614771501773.png

I tried changing the line:

Set(varCurrRecord,Param("ID");

to:

Set(varCurrRecord,Param("ID"));

as it looks like there is a closing bracket missing for the set command, but then I get the initial error above.

Cheers,

G.

RusselThomas
Microsoft
Microsoft

hi @Iamglt ,

Apologies, I spotted the missing bracket and updated my post after posting it.

With that sorted though, you can at least work through the type mismatch.

Out of interest, your variable name seems to imply that it contains a whole record, whereas here you're setting it to a single field value.  If it's meant to be a whole record, perhaps set it to the result of a lookup using the ID instead of setting it to the ID itself.

If it is being set to just the value of a record ID, this is a numerical value and parameters are by default text, so you may want to change it to 

If(
    Param("DL152") = "Screen1", 
       Set(varCurrRecord,Value(Param("ID")));
       Navigate(SScreen)
)

and see if that works?

Kind regards,

RT

View solution in original post

Bingo - that worked.

Thanks,

G.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (94,391)