Join us Dec. 16 for The Community Hour, our first global virtual User Group event!

Build Agent Prompt

Ankita Bisht
Mega Sage

Hi All,

 

We are using Build Agent Tool to create a catalog item and flow in global scope. Facing the issue with writing the prompt for populating a group record in ask for approval action for flow. It's not populating the exact group we have  given in prompt. It's populates nothing.

AnkitaBisht_0-1787225507037.png

Prompt we have given is below:

Flow Name: Reach v2

Catalog Item: Reach for Amazing Platform

Trigger

  • Trigger the flow when a Requested Item (RITM) is created for the catalog item "Reach for Amazing Platform v2 ".

 

Approval Logic

Scenario 1: requested_for is same as opened_by

When the Requested For user and Opened By user are the same:

  1. Check whether the Requested For user is a member of the group "Onboarding HR Approval Group".

- If Yes:

- Auto-approve the Request Item.

- Set:

-Approval = Approved

-State = Work in Progress

- If No:

-add an 'Ask for Approval' action. Set the rules 'Approve or Reject' When 'Anyone approves or rejects' to group -'Onboarding HR Approval Group" having sys id  is '"8be2373e647e48b78ee8e3ee36487562"

- After approval:

- Set Approval = Approved

-Set State = Work in Progress

 

Any help would be appreciated. 

 

Thanks,

Ankita Bisht

2 REPLIES 2

pr8172510
Kilo Sage

Hi @Ankita Bisht,

The issue is likely the prompt ambiguity around the approval rule. Build Agent works better when you explicitly identify the table, field, group name, and sys_id, rather than describing the approval configuration only in natural language.

 

Update the existing Flow Reach v2. 

Trigger: When a Requested Item [sc_req_item] is created for catalog item Reach for Amazing Platform v2.

 

Condition: Compare requested_for and opened_by.

 

If requested_for == opened_by:

  1. Check whether requested_for is a member of the group:
    • Group name: Onboarding HR Approval Group
    • Group sys_id: 8be2373e647e48b78ee8e3ee36487562
  2. If the requested-for user is a member of this group:
    • Set approval = approved
    • Set state = Work in Progress
    • Do not create an approval request.
  3. If the requested-for user is NOT a member of this group:
    • Add exactly one Ask for Approval action.
    • Record: the current Requested Item [sc_req_item].
    • Approval rule: Anyone approves or rejects.
    • Approver type: Group.
    • Approver group: Onboarding HR Approval Group.
    • Group sys_id: 8be2373e647e48b78ee8e3ee36487562.
  4. After the approval action returns Approved:
    • Set approval = approved
    • Set state = Work in Progress


Do not leave the Group approver blank and do not use the current user's group dynamically.

 

Use the specific group record identified by sys_id 8be2373e647e48b78ee8e3ee36487562.

Hi @pr8172510 It didn't worked. I tried the below prompt

Create Flow Reach Amazing. 

 

Trigger: When a Requested Item [sc_req_item] is created for catalog item Reach for Amazing Platform.

 

Condition: Compare requested_for and opened_by.

 

If requested_for same as opened_by:

  1. Check whether requested_for is a member of the group:
    • Group name: Onboarding HR Approval Group
    • Group sys_id:1799640193b68b501a07f40ddd03d6e9
    • If the requested-for user is a member of this group:
    • Set approval = approved
    • Set state = Work in Progress
    • Do not create an approval request.
  2. If the requested-for user is NOT a member of this group:
    • Add exactly one Ask for Approval action.
    • Record: the current Requested Item [sc_req_item].
    • Approval rule: Anyone approves or rejects.
    • Approver type: Group.
    • Approver group: Onboarding HR Approval Group.
    • Group sys_id: 1799640193b68b501a07f40ddd03d6e9
    • After the approval action returns Approved:
    • Set approval = approved
    • Set state = Work in ProgressIt didn't worked and didn't populate in the as for approval actionAnkitaBisht_0-1787560970119.png

       

      Is there other way or prompt I can use?