With the “Add Document” Action in a Button/Rule: The Document Name field does not seem to allow references, e.g. `Collected Meeting Notes - <%= Entity.Client.Name %>
Both forms get interpreted literally:
Furthermore, I am unable to open the created document - on ALT-click, nothing happens.
And when I “Unlink” the Document, I see this:
I am getting this error now:
For this Rule:
I don’t know if it’s causing the error but i would suggest leaving the doc name field blank if you are setting it programmatically.
1 Like
I tried that - no difference. Also with dummy content, and blank content.
Oleg
June 1, 2022, 5:49am
6
Hi,
Init of Client.Name
is missing. Also the null ref check for Entity.Client
is required. Please try to use something like that:
UPDATED:
{!Client.Name!}
<% NAME("Collected Meeting Notes-" + Entity["Client.Name"])%>
Thanks,
Oleg
1 Like
@Oleg , I tried your suggestion, but I still get the error:
Failed to execute Action "Add Document": Response code 400 (Bad Request)
This rule also fails the same way:
Is the Meeting Notes relationship to Clients many-to-one?
Chr1sG
June 1, 2022, 2:45pm
10
I just noticed, I think you need all caps for NAME:
<% NAME("Collected Meeting Notes-" + (Entity.Client ? Entity.Client.Name : "No Client"))%>
Can you try that…
Thanks @Chr1sG - that fixes the error, but Entity.Client
is apparently empty (in both cases), as the Client.Name
substitution gives “No Client”.
Chr1sG
June 1, 2022, 3:02pm
12
Can you send a screen grab of the meeting notes you’re trying it on (or even better, a video of the automation being triggered and the outcome)
Chr1sG
June 1, 2022, 3:27pm
13
I’m not sure why Oleg’s suggestion is not working as intended, but here’s a JS-based workaround:
<%
const fibery = context.getService('fibery');
const x = await fibery.getEntityById(Entity.Type, Entity.Id, ['Client']);
const client = x['Client']['Name'];
%>
<% NAME("Collected Meeting Notes-" + client)%>
1 Like
Thanks @Chr1sG - that works for both triggers.
Oleg
June 2, 2022, 8:21am
15
Looks like I made a mistake in accessing one-to-one property.
I believe this is the correct code
{!Client.Name!}
<% NAME("Collected Meeting Notes-" + Entity["Client.Name"])%>
Oleg:
Entity["Client.Name"]
@Oleg , that returns null
, but @Chr1sG ’s solution works.