Hello,
I have one content type which is having store_id(text) name(text), address(text) and status(select list) fields in stores content type. I have to import fields from csv. I want to give conditions to it before importing.
I have below node in content
store_id Name address Status
1 aaaa aaaa archive
2 bbbb bbbb archive
1 dddd dddd open
1 eeee eeee close
Now I want to import below from csv
1 qqqq qqqq open
2 mmm mmm close
I want to update node having same booking id but not having status archive
so output I want is
1 aaaa aaaa archive(not update)
2 bbbb bbbb archive(not update)
1 qqqq qqqq open(update)
1 qqqq qqqq open(update)
2 mmm mmm close(new create)
Can you please give me any clues how to do this
Thank you
Comments
Comment #1
Sorin Sarca commentedFirst, I don't know what is booking id (maybe store_id???).
In order to do this you'll need a few things:
1) A simple function which checks if status is archive or not.
2) status field will have "Skip importing this item" for "Action when filtered result is empty"
3) add the above filter to status field
4) use for "xpath to a unique identifier of item" an xpath which points to store id
This steps assumes that you don't have any store saved yet, if there will be manually added stores then there is other way.
Today I think I will push to dev a patch which will do this more easy.
Comment #2
pramodini123 commentedHello,
Thanks for reply. I created custom module for this. problem solved.