Forum Discussion
Power M generated GUID, how to use in subsequent steps
- 1 year ago
Hi evanmandos,
We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.
If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.
Thank you.
Thankyou, lbendlin, for your response.
Hi evanmandos,
We sincerely appreciate your inquiry submitted through the Microsoft Fabric Community Forum.
Based on my understanding, this behaviour arises from the way Power Query operates. Power Query is a functional, stateless language, and expressions such as Text.NewGuid() are re-evaluated every time they are invoked, unless the result is materialised.
Kindly follow the steps mentioned below to persist your generated GUIDs across flow steps like 'add products' and 'add productitems', which may help resolve the issue:
-
In your 'add products' step, generate the GUID using the following code:
Table.AddColumn(#"Previous Step", "id2", each Text.NewGuid(), type text) -
Write this table to a persistent sink such as Azure Data Lake, Fabric Lakehouse, or any SQL destination.
-
In the 'add productitems' step, read from that sink instead of referencing the 'add products' step. This will ensure that the GUIDs are fixed and do not change with each query execution.
If you find our response helpful, kindly mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.
Thank you.