0

I'm trying to create a unique id in my lists, which is exported from a MS form. But I keep getting errors.

So my logic is very simple:

Step 1: once a form is submitted, the responses will be automatically send to the list. (I created a separate flow for this and everything works perfectly in this step.)

Step 2:once a new response is created in the list, an associated unique id will be generated for this new response.(This is the second flow I'm trying to create right now.)

I want the unique id to be: DP+request date+ID. For example, if the request date of the request is 10/26/2023, and it's the third request in the list, so the unique id for this request would be DP1026202300003.If the 16th request in the list has request date 08/12/2025, then its unique id would be DP0812202500016.

Here is my flow: initialize variable

Request Form Tracker - Data Pull is the list I created in the first step, where stores all the responses.

FYI:

  1. Here is the formula I use:concat('DP',formatDateTime(triggerOutputs()?['body/Request Date'],'yyyyMMdd'),formatNumber(triggerOutputs()?['body/ID'],'000000'))

2.The 'request date' is a required field in the form, which should be the same date that people submitted the form.

3.Request Form Tracker - Data Pull is the list I created in the first step, where stores all the responses.

4.'Request ID' is the name of the unique id in the list.

And here is the error I got: error message

I've also tried using the default Create date instead of the request date, but it didn't work either.

Can someone help me on this please?

Thanks!

1 Answer 1

0

The error shows you what the error is. The date field triggerOutputs()?['body/Request Date'] is empty, thus flow cannot do formatDateTime() operation with it. I recommend to use Created Date triggerOutputs()?['body/Created'], which is never null.

Working expression:

concat('DP',formatDateTime(triggerOutputs()?['body/Created'],'yyyyMMdd'),formatNumber(triggerOutputs()?['body/ID'],'000000'))

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.