Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How can we use get ([key or content ]) passing content as a parameter?

Avatar

Avatar
Validate 1
Level 4
pierrec70731455
Level 4

Likes

62 likes

Total Posts

59 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 4
pierrec70731455
Level 4

Likes

62 likes

Total Posts

59 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
pierrec70731455
Level 4

22-03-2019

Hi,

in the documentation it is quite clear how to load the entity corresponding to a given schema and key :

var delivery = NLWS.nmsDelivery.get("12435")

But I don't understand how/why we can pass a content as a parameter?

Kind regards,

Pierre

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 4
pierrec70731455
Level 4

Likes

62 likes

Total Posts

59 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 1
Level 4
pierrec70731455
Level 4

Likes

62 likes

Total Posts

59 posts

Correct Reply

14 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 25
View profile
pierrec70731455
Level 4

25-03-2019

Hi Jonas,

this question is indeed for Classic, I'm unable to change the tag now.

The load(key) method allows us to obtain an entity based on the key (id) of the schema : load

With the create([content]) method we can generate a new entity for a schema based on the content we send : create

So my question is how can we use the get([key or content]) with content as a parameter : get

In the doc they explain clearly how to get an entity with a get(key), but nothing on how to use get(content).

Kind regards,

Pierre

Answers (5)

Answers (5)

Avatar

Avatar
Establish
MVP
wodnicki
MVP

Likes

960 likes

Total Posts

1,087 posts

Correct Reply

507 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile

Avatar
Establish
MVP
wodnicki
MVP

Likes

960 likes

Total Posts

1,087 posts

Correct Reply

507 solutions
Top badges earned
Establish
Affirm 500
Contributor
Shape 1
Give Back 100
View profile
wodnicki
MVP

01-04-2019

Hi,

Pierre:

I think 'key or content' is mistranslated French here, and is meant to read 'numeric id or string key'.

Jonas:

That's a bug in the software.

Thanks,

-Jon

Avatar

Avatar
Validate 1
Level 3
jonasn92134656
Level 3

Likes

28 likes

Total Posts

38 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 3
jonasn92134656
Level 3

Likes

28 likes

Total Posts

38 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
jonasn92134656
Level 3

01-04-2019

I find the behaviour strange. This for instance actually creates a new recipient for me:

var recipient = NLWS.nmsRecipient.get(

  {recipient: {

  email: "support@adobe.com"

})

I only noticed cause it's throwing an error in the instance I tried it (which is expected, duplicate key on ID field).

The same but for deliveries using internal name returns the correct record as expected (NLWS.nmsDelivery.get using internalName). Haven't looked into it further though. I usually use queryDef for these kinds of things, so that might be an option for you as well.

Regards,

Jonas

Avatar

Avatar
Springboard
MVP
Florian_Courgey
MVP

Likes

93 likes

Total Posts

87 posts

Correct Reply

19 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 1
View profile

Avatar
Springboard
MVP
Florian_Courgey
MVP

Likes

93 likes

Total Posts

87 posts

Correct Reply

19 solutions
Top badges earned
Springboard
Validate 1
Establish
Contributor
Ignite 1
View profile
Florian_Courgey
MVP

27-03-2019

Hi,

We do have the same question.. This is what we tried so far, but it always gives us an empty recipient as a result

var recipient = NLWS.nmsRecipient.get({

  where: {

    condition: {expr: "@email= 'my@email.com'"}

  }

});

var recipient = NLWS.nmsRecipient.get({ 

    condition: {expr: "@email= 'my@email.com'"}

});

var recipient = NLWS.nmsRecipient.get({ 

    expr: "@email= 'my@email.com'"

});

var recipient = NLWS.nmsRecipient.get({ 

    email: 'my@email.com'

});

logInfo('recipient: '+recipient);

logInfo('id: '+recipient.id);

logInfo('email: '+recipient.email);

It always return a [WppObject] (a recipient as a JS object) with empty properties:

recipient: [object WppObject]

id: 0

email:

Tested in a javascript activity of a workflow, but can be used anywhere (JSSP, web apps...)

Thank you

Avatar

Avatar
Validate 250
Level 10
pablo_rosero1
Level 10

Likes

81 likes

Total Posts

348 posts

Correct Reply

77 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile

Avatar
Validate 250
Level 10
pablo_rosero1
Level 10

Likes

81 likes

Total Posts

348 posts

Correct Reply

77 solutions
Top badges earned
Validate 250
Validate 100
Validate 50
Validate 25
Validate 10
View profile
pablo_rosero1
Level 10

26-03-2019

Avatar

Avatar
Validate 1
Level 3
jonasn92134656
Level 3

Likes

28 likes

Total Posts

38 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile

Avatar
Validate 1
Level 3
jonasn92134656
Level 3

Likes

28 likes

Total Posts

38 posts

Correct Reply

8 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 25
Boost 10
View profile
jonasn92134656
Level 3

25-03-2019

Hi,

This question is related to Classic and not Standard right? (the post is tagged as standard)

  • What is the context? JSSP/workflow/etc?
  • What do you mean by "pass a content as a parameter"?

Regards,

Jonas