How to update a event without knowing the eventid but some dataeelement value, something like choosing event by filter

I want update an existing event , by way of selecting using the DE value. how? can?
Thanks.

Hi @linxd,

Thanks for your question :slight_smile: You can get events knowing the data element value from API, but you also need a program stage id. You can do it by sending GET request to /events/query. Example URL that works on play database:

/api/events/query.json?orgUnit=DiszpKrYNg8&programStage=Zj7UnCAulEk&filter=qrur9Dvnyt5:GT:20:LT:50

When you know event id, you can send PUT request to update the event. You can find out more about the API endpoint here.

Hope this helps.

Gintare

1 Like

I want bulk update the events. not only defined one. but some events match
de.value=‘some value’

1 Like

Hi @linxd did you manage to do a bulk update?

1 Like

yes, like :slight_smile:
updae events where events.de=‘somevalue’

1 Like

That’s really great @linxd! Please mark as solved even if it’s your post! :smiley: :+1:

was it through API or an SQL query?

API. I mean I want do update events with API like sql : update events where ev.de=‘??’

1 Like