Hello all, thanks in advance for any help!
I'm trying to set up a PowerAutomate Flow which (amongst other things) creates a new Marketing Form preferably based on a Form Template and then embeds this new Marketing Form on a Marketing Page for public consumption. I've hit two issues which I'm hoping someone can help with.
- Creating the Marketing Form with a Flow is easy enough but I'm not quite getting the results I expect. When you do this manually, if you change the "Marketing Form Template" being used then the form designer view reflects that template. I had thought that if I specified the template when creating the new Marketing Form that might give me what I needed. My second attempt was to add a further step to update the template field on the newly created row but that doesn't appear to do anything. The result either way is the default email field and submit button (even with the default field set to "No" or null)
- I have a work around for the above: I can replicate the form using HTML in a variable and then pass that to the Marketing Form when created... but it'd be a lot easier if I could just use a template which users could then edit when needed. UPDATE: this does work but you also have to pass the field mappings
- The real sticking point is how to embed the newly created Marketing Form on a new Marketing Page which will also be created within the Flow. Rather than create this from scratch I thought the easiest would be to pass a variable with the html code for the whole page into the create row action and that somewhere in that code I could embed the GUID of the new Marketing Form. I created a marketing page manually so I could get at the relevant HTML (extract below), there is certainly what looks like a Dataverse GUID, but it isn't the GUID of the Marketing Form that's been added to that page. UPDATE: so this GUID is for a Form Page record which would normally be created in the background when a Form is manually added to a marketing page. There's no documentation on this table that I can find and it's not clear exactly what it does, it's behaviour can be a little strange. It contains lookup fields for both the Form and the Page and then seems to duplicate some fields of both.
An extract of the Marketing page HTML:
<div data-editorblocktype="Text" style=""><p>Marketing Form</p>
</div><div data-editorblocktype="FormBlock" style="" data-form-block-id="74b983d1-cf59-0dd2-bd4d-0e49433858c9"></div>