cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SeanBuckley2698
Regular Visitor

I want to give the user back a Reference Number which is generated when the user adds an item in a form

Hi, I was wondering what would be the best way of giving the reference number back to the user after they enter a form submission? The reference number is generated in the sharepoint list when the user adds an item. I would like to give them this reference number back in the form of a notification in the app.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @SeanBuckley2698 :

Could you tell me what Reference's data type is?

I assume it is a calculation type(or text type), then it will be mapped to powerapp as text type.

In my original solution, I used Text(ID) to convert ID to Text type, but if Reference is originally Text type, it can be directly referenced without the Text() function.

Please try:

 

SubmitForm(XXXXX);/*submit the record*/
Notify(
    "The reference number of the record you just submitted is:" & 
        First(
            Sort(
                'Your SP list',
                Modified,
                Descending
            )
        ).Reference

)

 

Best Regards,

Bof

View solution in original post

7 REPLIES 7
krishnags
Responsive Resident
Responsive Resident

@SeanBuckley2698 If you are using Form Control - you can leverage "LastSubmit" of the Form Control. If you are using Patch, try using ClearCollect(colSubmittedData,Patch Function goes here). colSubmittedData.ID - gives you ID for a submitted record

 

You can refer this too -

https://www.youtube.com/watch?v=R0aZipw8S_U

https://mspowerassist.blogspot.com/2020/08/how-to-show-successfully-submitted.html

TesDA
Continued Contributor
Continued Contributor

You could also just add a note to the screen with a lookup to the reference number:

 

ThisItem.ID or if they selected the item from a Gallery: GalleryNameHere.Selected.ID

RMC-Pro
Helper II
Helper II

Maybe sending an e-mail to a user  with submission confirmation and record ID (e.g., ThisItem.ID, colSubmittedData.ID) could be the solution for you - if this is not too frequent and you want to provide proof of evidence for user.

v-bofeng-msft
Community Support
Community Support

Hi @SeanBuckley2698 :

Do you want to inform the user of the value of the "reference number" just submitted by a notification?

Could you tell me what reference number's data type is?I assume it is 'Number'.

I sugget you use Notify(),I'v made a test for you reference:

 

Patch(XXXXX);/*submit the record*/
Notify(
    "The reference number of the record you just submitted is:" & Text(
        First(
            Sort(
                'Your SP list',
                Modified,
                Descending
            )
        ).ID
    )
)

 

Or

 

SubmitForm(XXXXX);/*submit the record*/
Notify(
    "The reference number of the record you just submitted is:" & Text(
        First(
            Sort(
                'Your SP list',
                Modified,
                Descending
            )
        ).ID
    )
)

 

51.gif

Best Regards.

Bof

 

Thanks a lot and yes it is Number type. I will try this out.

Hi I tried this code and it worked with ID but I have a column that calcs a reference number and that's the column  I need to pull in. Do you know why it wouldn't be working with the reference column. I only replaced the .ID with .Reference

Hi @SeanBuckley2698 :

Could you tell me what Reference's data type is?

I assume it is a calculation type(or text type), then it will be mapped to powerapp as text type.

In my original solution, I used Text(ID) to convert ID to Text type, but if Reference is originally Text type, it can be directly referenced without the Text() function.

Please try:

 

SubmitForm(XXXXX);/*submit the record*/
Notify(
    "The reference number of the record you just submitted is:" & 
        First(
            Sort(
                'Your SP list',
                Modified,
                Descending
            )
        ).Reference

)

 

Best Regards,

Bof

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,865)