Copy link to clipboard
Copied
Thanks to your help, I can get a list of data from the table and enter my data there if necessary. Now I was wondering, can I find out how many rows are in the table?
value = {{RegItemId = 01ItemId, RegOrgId = 01OrgId},{RegItemId = 02ItemId, RegOrgId = 02OrgId},{RegItemId = 03ItemId, RegOrgId = 03OrgId}}
photo:setRawMetadata ("registryId", value)
That is, I have 3 rows in the registryId table. And if there is a possibility in the code to find out how many lines there, if I do not know it?
Thanks in advance!
The table in the variable "value" is an array, and Lua gives the number of elements in an array using the "#" operator, e.g.
#value
Copy link to clipboard
Copied
The table in the variable "value" is an array, and Lua gives the number of elements in an array using the "#" operator, e.g.
#value
Copy link to clipboard
Copied
Thanks! It is WORK:
local LrApplication = import("LrApplication")
local catalog = import("LrApplication").activeCatalog()
local targetPhoto = catalog:getTargetPhoto ()
a = targetPhoto:getFormattedMetadata ("registryId")
return #a
Answer 3