Avatar of kwamemiller
kwamemiller asked on

Need help writing a simple agent

Hi, I need to write an agent to replace the values of a field AccountManager when its value is empty to become "administrator". I have written the code below but it doesn't work. Does anyone know why?
@If(AccountManager="";"administrator";AccountManager);
Lotus IBM

Avatar of undefined
Last Comment
Sjef Bosman

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
qwaletee

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Sjef Bosman

Hi kwamemiller,

The formula seems OK, Do you have sufficient access to the documents? Is it a special field (Reader/Author)?

Cheers!
   Sjef
ASKER
kwamemiller

Thanks qwalatee, your code works!! Don't know why the code I wrote doesn't execute though but in the meantime, I'll be using your code. Thanks also to Sjef.
Kwame
qwaletee

Agents have two parts -- one part tells it which documents "qualify" (the SELECT), the rest tells the agent what to do with the qualifying document.

So, we select docs that have a blank value.

OK, now what do we do with it?  Well, we can't just write "administrator" -- we have to tell it what to DO with administrator.  So, we tell it that there is a field named AccountManager that we wish to change to this value.  (The fact that the SELECT mentioned this field means nothing, since you might want to qualify based on one field, but change a different field.)
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Sjef Bosman

All points to Qwaletee!