Hi @parth3
refer
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-generate-dynamic-number-based-id-when-creating-a-new-content/m-p/548711
https://experienceleague.adobe.com/en/docs/experience-manager-core-components/using/wcm-components/content-fragment-list
To ensure that the unique ID remains unique across multiple folders when uploading content fragment data via a POST request, you can use a custom workflow process or a custom script to handle the uniqueness constraint.
1. Create a custom workflow process: In AEM, you can create a custom workflow process that runs after the content fragment is created or updated. This workflow process will handle the uniqueness constraint for the unique ID property.
2. Implement the uniqueness check: In the custom workflow process, you can implement the logic to check if the unique ID already exists across both folders (EN and FR). You can use the AEM Query Builder or the JCR API to query the repository and check if any content fragments with the same unique ID exist.
3. Handle the uniqueness constraint: If a content fragment with the same unique ID is found, you can handle the uniqueness constraint by either rejecting the new content fragment or modifying the unique ID to make it unique. For example, you can append a suffix or generate a new unique ID.
4. Update the content fragment: After handling the uniqueness constraint, you can update the content fragment with the modified unique ID or proceed with the creation/update process.
5. Configure the workflow: Configure the custom workflow process to be triggered after the content fragment is created or updated. You can associate the workflow process with the specific content fragment model or use other criteria to trigger the workflow.