I am trying to send an email of a link to a specific item when it is created. This is in my on start - et(varReqID,Value(Param("TestID"))); If(varReqID <>0, Set(varRecord,LookUp('OSC CR', ID = varReqID));Navigate(DetailsScreen)). This is the button for the form the user submits - ffice365Outlook.SendEmailV2("email", "Sub", "<a href='https://apps.powerapps.com/play/a8571e60-77bc-462d-8ecd-a3be7d6eb8ea?tenantId=5dbf1add-202a-4b8d-815..." & varRecord.ID & "'> CR link</a> "); SubmitForm(Form1); .
The problem is that the gallery I have on a different screen doesn't update in time, so it sends an email to the user like this https://apps.powerapps.com/play/a8571e60-77bc-462d-8ecd-a3be7d6eb8ea?tenantId=5dbf1add-202a-4b8d-815.... The specific TestID number is missing, but if I go in the gallery and resubmit it, then it works. The user wont have access to the gallery it's just in the backend to pull the ID to email to the user. How can I get the gallery to update faster so the full link including the TestID sends to the user.
Hi @powerapps890 ,
I have a confusion that why is the Test ID related to the Gallery? From the code above, I just find the Test ID is from the varRecord which is retrieved from 'OSC CR'.
Could you please elaborate more about your scenario to help us understand your issue. If the user don't have access to the gallery, how do you want the user get Test ID from gallery?
Sik
Because varRecord is the entire gallery. The TestID is the unique identifier. When the person opens up the email I want it to take them to the specific form the user submitted, not the gallery. @v-siky-msft test id=2 for example needs to be in the URL for this to happen, but the link is not sending correctly, it is sending without the testID @v-siky-msft
Hi @powerapps890 ,
Sending mail and having visitors access form through links should be two different phases. From my view, I think you missed assignment of varRecord variable before sending the email. Before sending an email, you should set the current selection as varRecord variable when selecting item in the gallery.
Gallery.OnSelect: Set(varRecord, ThisItem)
Hope this helps.
Sik
@v-siky-msft I already have that. Now the number is sending with the link, but it's the same number every time. Now when I go into the gallery it shows the correct ID, but I need the email link to send with the correct ID.
Hi @powerapps890 ,
Each time you want change the items id, you must go to gallery to select the item first and then send the email.
Do you mean the assignment of varRecord.ID is correct, but variable doesn't work in the Email body, right?
Sik
I think? Because when I submit the form it goes into the gallery correctly with the correct ID. But I have tried altering the initial link by using the datacardvalue of ID in the datasource and the ID never changes it will always be the last ID I clicked in the gallery. What I want is simple I think. The user submits a form, it goes into the gallery, a link it sent to an email and when the email opens up that specific record opens up. @v-siky-msft I am just not sure why sometimes it will send without a testID and sometimes the testID will not change. I will thinking I could do something like pull the last ID +1 in a datacard. Would this solve the issue and then on the button put that datacard value. @v-siky-msft
Hi @powerapps890 ,
So you want to the ID of last submitted item from From, right?
I would suggest you put the following code to OnSuccess property of Form, this can save the last submitted record to the variable.
Set(VarRecord, FormName.LastSubmit)
Hope this helps.
Sik
This did not work. Would it be possible to use a lookup in the ID card and then add one to it? Then put that datacard in the link that is the only way I could think of it to work. What would the lookup be? @v-siky-msft
Hi @powerapps890 ,
I'm not sure, but code could be like this?
Set(varRecord,LookUp('SP list', ID= (Value(IDLabel.Text)+1)))
Sik
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
269 | |
252 | |
86 | |
37 | |
33 |
User | Count |
---|---|
342 | |
263 | |
129 | |
68 | |
45 |